feat(proto, sequencer)!: use full IBC ICS20 denoms instead of IDs#1209
feat(proto, sequencer)!: use full IBC ICS20 denoms instead of IDs#1209SuperFluffy merged 9 commits intomainfrom
Conversation
cab1204 to
476e4fa
Compare
| ASTRIA_COMPOSER_GRPC_ADDR="0.0.0.0:0" | ||
|
|
||
| # The asset to use for paying for transactions submitted to sequencer. | ||
| ASTRIA_COMPOSER_FEE_ASSET="nria" |
There was a problem hiding this comment.
Note that this sets the payment fee for all actions to nria - the same as was previously hard coded. This might not be exactly what we want to do in the future.
| seq_action: SequenceAction, | ||
| }, | ||
| #[error(transparent)] | ||
| FinishedQueueFull(Box<FinishedQueueFull>), |
There was a problem hiding this comment.
This is a clippy-fix because the variant was too big.
| @@ -1,19 +1,22 @@ | |||
| #[cfg(test)] | |||
There was a problem hiding this comment.
The structure of these modules was extremely strange and needed to be updated.
| }); | ||
| }; | ||
| let asset_id = hex::decode(asset_id) | ||
| let asset = <[u8; 32]>::from_hex(asset_id) |
There was a problem hiding this comment.
I am torn on this one. The request still has the form asset/denom/<hex>. So asset/denom/ibc/<hex> isn't allowed, and neither is asset/denom/port/channel/base.
...s/snapshots/astria_sequencer__accounts__state_ext__tests__storage_keys_have_not_changed.snap
Show resolved
Hide resolved
crates/astria-bridge-withdrawer/src/bridge_withdrawer/submitter/mod.rs
Outdated
Show resolved
Hide resolved
| pub data: Vec<u8>, | ||
| /// asset to use for fee payment. | ||
| pub fee_asset_id: asset::Id, | ||
| pub fee_asset: asset::Denom, |
There was a problem hiding this comment.
we should enforce for all actions that if the denom trace is >32 bytes, it must be in ibc/ prefixed form. ie don't accept traces that are excessively long as it's a DOS vector
There was a problem hiding this comment.
Do you mean we should enforce this when parsing string fee_asset -> asset::Denom? Technically the upper limit for protobuf payloads is 4MB and sequencer just rejects payloads >200KB, but I can add an additional limit on the type of course.
9374b33 to
e968da4
Compare
joroshiba
left a comment
There was a problem hiding this comment.
approval for infra components
f06975d to
9df3bd7
Compare
* main: (27 commits) refactor(sequencer): fix prepare proposal metrics (#1211) refactor(bridge-withdrawer): move generated contract bindings to crate (#1237) fix(sequencer) fix wrong metric and remove unused metric (#1240) feat(sequencer): implement transaction fee query (#1196) chore(cli)!: remove unmaintained rollup subcommand (#1235) release(sequencer): 0.14.1 patch release (#1233) feat(sequencer-utils): generate example genesis state (#1224) feat(sequencer): implement abci query for bridge account info (#1189) feat(charts): bridge-withdrawer, smoke test, various chart improvements (#1141) chore(charts): update for new geth update (#1226) chore(chart)!: dusk-8 chart version updates (#1223) release(conductor): fix conductor release version (#1222) release: dusk-8 versions (#1219) fix(core): revert `From` ed25519_consensus types for crypto mod (#1220) Refactor(chart, sequencer): restructure sequencer chart, adjust configs (#1193) refactor(withdrawer): read from block subscription stream and get events on each block (#1207) feat(core): implement with verification key for address builder and crypto improvements (#1218) feat(proto, sequencer)!: use full IBC ICS20 denoms instead of IDs (#1209) chore(chart): update evm chart for new prefix field (#1214) chore: bump penumbra deps (#1216) ...
Summary
Replaces the bare asset ID bytes by full IBC ICS20 denoms.
Background
Bare denom IDs in public APIs are difficult to understand. While IBC ICS20 denoms are prescribed to either contain strings of the form
port/channel/denomoribc/<sha256-hex>, due to protobuf-to-json mapping protobufbytesare always encoded as base64. With #1181 we parse denoms into either of the two forms and can thus allow users to provide assets as protobufstrings which are then parsed by sequencer.In addition, since denominations of the form
port/channel/denomcan always be converted toibc/<sha256>, this allows for more elegant fetching of denom-related data from storage.Changes
bytes asset_id -> string assetbytes fee_asset_id -> string fee_assetrepeated bytes fee_asset_ids -> repeated string fee_assets(and renameAllowedFeeAssetIdsResponsetoAllowedFeeAsssetsRersponse)astria-coretypes to parse the asset strings toastria_core::primitive::v1::asset::Denoms instead of[u8; 32]arrays.astria_core::primitive::v1::asset::IdtypeStateWriteExtandStateWriteReadtypes that read or write assets to disk:asset::Ids (in practice[u8; 32]), they now writeasset::IbcPrefixedTAsset: Into<asset::IbcPrefixed>which allows fetching data usingastria::Denoms,astria::TracePrefixed, orastria::IbcPrecixedastria-clisubcommands that construct actions with assets to have arguments--assetor--fee-asset(using"nria"as the default if not provided)ASTRIA_COMPOSER_FEE_ASSETTesting
All tests that involve fees were updated and pass again.
Breaking Changelist